<template>
<div>
  <div v-if="collectList.length === 0">
    <el-empty description="暂时没有收藏列表哦" />
  </div>
  <div style="margin-left: 15px;margin-bottom: 20px" v-else>
    <div style="margin-bottom: 15px">
      <h4>点击收藏夹查看详细内容</h4>
    </div>
    <div v-for="item in collectList" style="display: inline-block;margin-left: 30px">
      <el-button type="primary" plain @click="goCollectArticle(item)">
        {{ item.collectName }}
      </el-button>
    </div>
  </div>
</div>
</template>

<script>
import request from "../../../../utils/request";

export default {
  name: "msgCollect",
  data:function (){
    return{
      usersId:"",
      collectList:[],
    }
  },
  methods:{
    goCollectArticle(item){
      this.$router.push({
        path:"/collectArticle/"+item.collectName+'/'+item.collectId,
      })
    },
    initCollect(){
      request.get("/collect/selectUsersMsgCollect/"+this.usersId).then(res=>{
        this.collectList=res.data;
      });
    }
  },
  created() {
    this.usersId=this.$route.params.usersId;
  },
  mounted() {
    this.initCollect()
  }
}
</script>

<style scoped>

</style>